package com.java.tutorials.spring;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Created by xuzhike on 2016/1/27.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath*:Spring-ApplicationContext.xml"})
public class SpringTesterBase {
    @Autowired
    public ApplicationContext ctx;

    @Test
    public void testAppCTX(){
//        ResourceBundleMessageSource source =(ResourceBundleMessageSource) ctx.getBean("messageSource");
//        System.out.println(source);
//        String str1 = source.getMessage("user.name",null, Locale.US);
//        System.out.println("name="+str1);
    }

    public static void printMsg(Object obj){
        System.out.println(obj);
    }

}
